<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表格标签</title>
</head>
<body>
<!--
    1.表格示例
    tr 一行
    th 列名 - 加粗,居中
    td 一列
    border="1" 设置边框 单位默认为像素 也可以写成'1px'
    style="border-collapse: collapse" 设置实线边框
-->
<table border="1" style="border-collapse: collapse">
    <caption>爱好表</caption>
    <tr>
        <!--第一行-->
        <th>序号</th>
        <th>姓名</th>
        <th>爱好</th>
    </tr>
    <tr>
        <!--第二行-->
        <td>1</td>
        <td>传奇</td>
        <td>玩偶</td>
    </tr>
    <tr>
        <!--第三行-->
        <td>2</td>
        <td>伟超</td>
        <td>丽颖</td>
    </tr>
    <tr>
        <td>3</td>
        <td>硕博</td>
        <td>伟超</td>
    </tr>
</table>
<hr>
<!--2.跨列合并与跨列合并-->
<table border="1px" style="border-collapse: collapse">
    <tr>
        <td>1-1</td>
        <td>1-2</td>
        <td>1-3</td>
        <td>1-4</td>
    </tr>
    <tr>
        <!--跨列合并-->
        <td colspan="2">2-1</td>
        <td>2-3</td>
        <!--跨行合并-->
        <td rowspan="3">2-4</td>
    </tr>
    <tr>
        <td>3-1</td>
        <td>3-2</td>
        <td>3-3</td>
    </tr>
    <tr>
        <td>4-1</td>
        <td>4-2</td>
        <td>4-3</td>
    </tr>
</table>
<hr>
<!--练习-->
<table border="1" style="border-collapse: collapse">
    <caption>购物车</caption>
    <tr>
        <th>商品编号</th>
        <th>商品名称</th>
        <th>商品价格</th>
    </tr>
    <tr>
        <td>1</td>
        <td>小米air</td>
        <td>5877</td>
    </tr>
    <tr>
        <td>2</td>
        <td>华为遥遥领先</td>
        <td>8877</td>
    </tr>
    <tr>
        <td>总价</td>
        <td colspan="2">10000</td>
    </tr>
</table>
<hr>
<!--课程表练习-->
<table border="1" style="border-collapse: collapse">
    <caption>
        <h1>课程表</h1>
    </caption>
    <tr>
        <th></th>
        <th>星期一</th>
        <th>星期二</th>
        <th>星期三</th>
        <th>星期四</th>
        <th>星期五</th>
    </tr>
    <tr>
        <td rowspan="4">上 <br> 午</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td colspan="6">&nbsp;</td>
    </tr>
    <tr>
        <td rowspan="3">下 <br> 午</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
</table>
</body>
</html>